<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('查看审批')"/>
</head>
<body>
<form class="layui-form" action="">
    <div class="mainBox">
        <div class="main-container">
            <div class="main-container">

                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">id</label>
                    <div class="layui-input-block">
                        <input type="text" th:value="${lab.id}" name="id">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">实验室名称</label>
                    <div class="layui-input-block">
                        <input type="text" th:value="${lab.labName}" readonly style="width: 250px" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">图片</label>
                    <div class="layui-input-block">
                        <img scr="" id="user-img" style="width: 500px;height: 300px;">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">实验室描述</label>
                    <div class="layui-input-block" style="width: 150px">
                        <input type="text" th:value="${lab.remark}" readonly class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">状态</label>
                    <block th:if="${lab.status} eq 0">
                        <a class="pear-btn pear-btn-success pear-btn-sm" style="cursor:default">
                            正常使用
                        </a>
                    </block>
                    <block th:if="${lab.status} eq 1">
                        <a class="pear-btn pear-btn-danger pear-btn-sm" style="cursor:default">
                            不可借用
                        </a>
                    </block>
                </div>


                <block th:if="${lab.requisition} eq 0">
                    <div class="layui-form-item">
                        <label class="layui-form-label">借用状态</label>
                        <a class="pear-btn pear-btn-success pear-btn-sm" style="cursor:default">
                            未借用
                        </a>
                    </div>
                </block>

                <block th:if="${lab.requisition} eq 1">
                    <div class="layui-form-item">
                        <label class="layui-form-label">借用状态</label>
                        <a class="pear-btn pear-btn-danger pear-btn-sm" style="cursor:default">
                            借用中
                        </a>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">借用人</label>
                        <div class="layui-input-block" style="width: 150px">
                            <input type="text" th:value="${lab.requisitionName}" readonly class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">归还时间</label>
                        <div class="layui-input-block" style="width: 150px">
                            <input type="text" th:value="${lab.returnTime}" readonly class="layui-input">
                        </div>
                    </div>

                </block>

            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="button" class="pear-btn pear-btn pear-btn-sm" onclick="myclose();"><i
                    class="layui-icon layui-icon-ok"></i> 返回
            </button>
        </div>
    </div>
</form>
<th:block th:include="include :: footer"/>

<script th:inline="javascript">
    layui.use(['form', 'jquery'], function () {
        let $ = layui.jquery;

        $("#user-img").attr("src", "/file/download/" + [[${lab.image}]]);
        window.myclose = function () {
            parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
            parent.layui.table.reload("user-table");
        }

    })
</script>
</body>
</html>